# Contributor: Carlo Landmeter <clandmeter@alpinelinux.org>
# Maintainer: Carlo Landmeter <clandmeter@alpinelinux.org>
pkgname=sos
pkgver=0.8
pkgrel=21
pkgdesc="Simple Object Storage"
url="https://github.com/skx/sos"
license="GPL-2.0-or-later"
arch="all"
options="chmod-clean"
makedepends="go"
source="sos-$pkgver.tar.gz::https://github.com/skx/sos/archive/release-$pkgver.tar.gz
	use-go-modules.patch
	"
builddir="$srcdir/sos-release-$pkgver"

export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"

build() {
	go build -v \
		-trimpath \
		-ldflags="-X main.version=$pkgver" \
		-o ./bin/sos
}

check() {
	go test ./...
}

package() {
	install -Dm755 bin/sos "$pkgdir"/usr/bin/sos
}

sha512sums="c2b69ec5d945725a4d3ae765622c97a3f5dfecf0550309593e33b68b842855746711f74254d8a70e0754ee66a6dd7a279f5ac414274697086e086ba78d2b9c83  sos-0.8.tar.gz
c3389ac657de9873844e041b394f1b3432e855c15e85d41f61a1ba5c9b91f1c7a459c9ad2af49e1dd21fa98dec9266cba38c4100594338bdbf9e801e5c5a0367  use-go-modules.patch"
